import {HashRouter as Router,Switch,Route,Redirect}from 'react-router-dom'
import Home from '../Views/Home'
import Fast from '../Views/Fast'
import User from '../Views/User'
import App from '../App'
import Login from '../Views/Login'
import Reg from '../Views/Reg'
import Toggle from '../Views/Toggle'
import SelectQs from '../Views/SelectQs'
import Practice from '../Views/Practice'

const BaseRouter = ()=>{
    return(
        <Router>
            <Switch>
                {/* <Route path="/login" component={Login}></Route>
                <Route path="/reg" component={Reg}></Route> */}
                <Route path="/" component={()=>{
                    return (
                        <App>
                        <Switch>
                        <Route exact path="/home" component={Home}></Route>
                        <Route exact path="/fast" component={Fast}></Route>
                        <Route exact path="/user" component={User}></Route>

                        <Route exact path="/sq/:actionCode" component={SelectQs}></Route>
                        <Route exact path="/practice" component={Practice}></Route>
                        <Route exact path="/toggle" component={Toggle}></Route>
                        <Route path="/login" component={Login}></Route>
                        <Route path="/reg" component={Reg}></Route>
                        <Redirect to='/home'></Redirect>
                        {/* Redirect 重定向 */}
                        </Switch>
                    </App>
                    )
                }}></Route>
            </Switch>
        </Router>
    )
}
export default BaseRouter